Fix GetRawUnit for v1 MPR files: convert UUID to GUID blob#706
Open
densmoe wants to merge 1 commit into
Open
Conversation
GetRawUnit passed the UUID string directly to SQLite for v1 MPRs, but UnitID is stored as a 16-byte GUID blob. The query never matched, silently returning "no rows" for every unit lookup on v1 projects. Use types.UUIDToBlob() before querying, consistent with getUnitByIDV1() in reader_units.go and GetRawUnitBytes() in writer_security.go which already have the correct implementation. Fixes mendixlabs#705 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetRawUnit()insdk/mpr/reader_documents.gopasses the UUID string directly to SQLite on v1 MPRs, butUnitIDis stored as a 16-byte GUID blob — the query never matchestypes.UUIDToBlob()conversion before the query, consistent withgetUnitByIDV1()andGetRawUnitBytes()which already do this correctlyFixes #705
Impact
Any caller combining
ListPages()/ListSnippets()/etc. withGetRawUnit(id)on a v1 project (Mendix < 10.18) getssql: no rows in result setfor every unit. This makesGetRawUnitunusable on v1 MPR files.Test plan
GetRawUnitnow returns valid BSON data for all page/snippet/layout units🤖 Generated with Claude Code